Skip to content

Choice of artefacts language - #475

Open
korhenon wants to merge 10 commits into
mainfrom
choice-of-artefacts-language
Open

Choice of artefacts language#475
korhenon wants to merge 10 commits into
mainfrom
choice-of-artefacts-language

Conversation

@korhenon

@korhenon korhenon commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

#459

Реализован перевод отчётов на другие языки. Для основных языков можно задать все строки для перевода, остальные будут иметь, некоторый текст на английском.

Русский

Отчёт Что было сделано
изображение изображение

Китайский

Отчёт Что было сделано
изображение изображение

@korhenon korhenon self-assigned this Jun 20, 2026
@korhenon korhenon linked an issue Jun 20, 2026 that may be closed by this pull request
@DRMPN

DRMPN commented Jun 21, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

f"for <a href='{self.repo_url}' color='#00008B'>{name}</a>",

P3 Badge Localize the report subtitle

When artefacts_language is set to a non-English language, the main title comes from ReportTranslationManager but this subtitle still hard-codes the English word for, so every localized PDF starts with a mixed-language header such as a Russian title followed by for <repo>. Route this literal through the same translation table so the first page is consistently localized.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return self.get("no")
elif key == YesNoPartial.PARTIAL:
return self.get("partial")
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve unknown Yes/No/Partial values

When the model returns Unknown for a YesNoPartial field, or when TextGenerator.make_request() falls back to the default RepositoryReport after a parse failure, this fallback returns None. The report renderer then prints None for README/test checks that are actually unknown; before this change those enum values were rendered as Unknown, so the generated PDF now misreports indeterminate analysis results instead of preserving that state.

Useful? React with 👍 / 👎.

Comment thread osa_tool/config/prompts/analysis.toml Outdated
- Check for the presence of the directory with tests
- Prioritize 3 most critical recommendations

- Write text in values on {target_language}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep file names out of translation

For non-English reports this blanket instruction applies to every JSON value, including structure.missing_files, which is later joined directly into the PDF. That can cause the model to translate concrete repository paths or filenames such as tests/requirements.txt, so the report can name files that do not actually exist instead of preserving the missing artifact names verbatim. Add an explicit exception for file, directory, package, and operation identifiers.

Useful? React with 👍 / 👎.

@DRMPN DRMPN left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Нужно обновить документацию docs.
  2. Посмотреть замечания кодекса, вроде по делу написал.
  3. Нам обязательно нужны эти шрифты в репозитории? Почему именно эти? Без них работать не будет? Стандартные чем-то не подходят? Может их в runtime подгружать с cdn какого-нибудь?

@korhenon
korhenon requested a review from DRMPN July 6, 2026 13:55
@DRMPN

DRMPN commented Jul 7, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de26b53613

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"""Store normalized result for a task, keyed by its human‑readable name."""
display_name = self._format_task_name(task)
self.results[display_name] = self._normalize_result(result)
self.results[task] = self._normalize_result(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the new report key when reading scorecard results

When --scorecard is enabled, _run_plan_operation now stores the report result under the raw task key "report", but WhatHasBeenDoneReportGenerator still reads self.task_results.get("Report") before building the before/after Scorecard section. In that scenario before_scorecard is always None, so the work summary silently falls back to a single after-score table instead of the intended comparison; either keep the display key here or update the downstream lookup to "report".

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korhenon эту проблему ты сейчас пофиксил, верно?

Comment thread osa_tool/run.py
sourcerank = SourceRank(config_manager)
scheduler = ModeScheduler(config_manager, sourcerank, args, workflow_manager, git_agent.metadata)
plan = scheduler.plan
artefacts_language = plan.get("artefacts_language")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor custom config when selecting artefact language

When the language is supplied through --config-file instead of the CLI flag, this still reads from the scheduler plan built from args; those argparse defaults were loaded from the bundled config before the custom TOML is parsed, and ConfigManager never copies [general].artefacts_language back into the plan. A run with a custom config setting artefacts_language = "Russian" will therefore keep using the bundled default English, so the new config option only works as a command-line flag unless this value is read from the loaded configuration or merged into the plan.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korhenon, пожалуйста, проверь это тоже

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас потестировал, эта проблема касается всех полей которые можно изменять и там и там, например translate_readme тоже затирается

Comment thread osa_tool/config/prompts/analysis.toml Outdated
- Check for the presence of the directory with tests
- Prioritize 3 most critical recommendations

- Write text in values on {target_language}, except names of files, directories and packages and operation identifiers

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep constrained enum fields in English

For a non-English report, this new rule tells the model to translate JSON values, but the readme Yes/No/Partial fields and documentation.tests_present are still validated against the English YesNoPartial enum. If the model follows the language instruction and emits localized values such as Да/Нет, TextGenerator.make_request() catches the validation failure and falls back to an all-Unknown report, so the prompt should explicitly exempt these constrained enum values from translation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот эта мне тоже кажется важной.

Comment thread osa_tool/config/settings/arguments.yaml Outdated
pdfmetrics.registerFont(TTFont("notosanssc-Bold", os.path.join(assets_dir, "notosans-sc-bold.ttf")))
pdfmetrics.registerFont(TTFont("notosanssc-Black", os.path.join(assets_dir, "notosans-sc-black.ttf")))

# 2. Регистрируем для него отдельное семейство (чтобы ReportLab не выдавал ошибок при попытке применить теги)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комментарии можно убрать

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему часть док стрингов была удалена?

Comment on lines +3 to +4
TRANSLATIONS = {
"English": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нам обязательно для каждого языка и модуля заполнять эти значения?

Если добавится поддержка китайского, то нужно будет ключ - значение и для него прописывать?

Я думаю может это ЛЛМке на откуп отдать?

Если у нас появятся другие значения, то как их добавлять? Может в конфиг или еще куда-то это вынести, а не в константой?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Add choice of language for generated artfacts

3 participants